package com.gdou.crrp.repository;

import com.gdou.crrp.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface UserRepository extends JpaRepository<User, Integer> {

    User findByPhone(String phone);

//    SELECT max(id) FROM tb_user_info;
    @Query( nativeQuery =true, value = "SELECT max(id) FROM tb_user_info")
    int findMaxUserId();

    User findById(int id);
}
